home *** CD-ROM | disk | FTP | other *** search
- on peekAlert
- global oStoryteller, oPuppeteer, gPeekAlertEnabled
- if (gPeekAlertEnabled = 0) or (getState(oStoryteller, #playerHasPeekUnit) = 0) then
- exit
- end if
- set colorGraphic to getAt(getProp(the lsInventoryData of oPuppeteer, #PeekUnit), 1)
- set highGlowGraphic to getAt(getProp(the lsInventoryData of oPuppeteer, #PeekUnit), 3)
- set lowGlowGraphic to getAt(getProp(the lsInventoryData of oPuppeteer, #PeekUnit), 2)
- set oldPeekGraphic to the castNum of sprite 7
- if oldPeekGraphic = colorGraphic then
- set lowGlowGraphic to colorGraphic
- end if
- set bigGlow to 1
- repeat with i = 1 to 12
- set startTix to the ticks
- repeat while the ticks < (startTix + 5)
- updateStage()
- end repeat
- if bigGlow = 1 then
- set the castNum of sprite 7 to highGlowGraphic
- else
- set the castNum of sprite 7 to lowGlowGraphic
- end if
- updateStage()
- set bigGlow to not bigGlow
- end repeat
- set the castNum of sprite 7 to oldPeekGraphic
- updateStage()
- end
-
- on setScanTime howManyMinutes
- global gScanFinish
- set gScanFinish to the ticks + (howManyMinutes * 3600)
- setState(oStoryteller, #PeekDisplay, value("#goodScan" & howManyMinutes & "min"))
- setState(oStoryteller, #PKscanStatus, value("#Wait" & howManyMinutes & "min"))
- peekAlert()
- end
-
- on approachOfficeLaptop
- global oStoryteller, oPuppeteer, gPsionFrames, gPsionSpins, gVoid
- set currentScreen to getState(oStoryteller, #BT_fragStatus)
- if currentScreen = #none then
- goTo(#OfficeMonitorCU, #lookAt)
- else
- setState(oStoryteller, #showMontage, 2)
- if currentScreen = #crisisPrompt then
- goTo(#OfficeMonitor_PTsuite, #lookAt)
- loadMultiFrames(#BT_continueBtn)
- loadMultiFrames(#BT_checkBox)
- loadMultiFrames(#BT_align_left)
- loadMultiFrames(#BT_align_right)
- loadMultiFrames(#BT_bias1)
- loadMultiFrames(#BT_bias2)
- loadMultiFrames(#BT_bias3)
- loadMultiFrames(#BT_psionFrames)
- end if
- if (currentScreen = #alignment) or (currentScreen = #spinningNow) then
- goTo(#OfficeMonitor_alignment, #lookAt)
- loadMultiFrames(#BT_checkBox)
- loadMultiFrames(#BT_align_left)
- loadMultiFrames(#BT_align_right)
- loadMultiFrames(#BT_bias1)
- loadMultiFrames(#BT_bias2)
- loadMultiFrames(#BT_bias3)
- loadMultiFrames(#BT_psionFrames)
- if gPsionSpins = [0, 0, 0] then
- set gPsionFrames to gVoid
- end if
- setState(oStoryteller, #BT_fragStatus, #spinningNow)
- end if
- if (currentScreen = #algoPrompt) or (currentScreen = #algorithm) then
- loadMultiFrames(#BT_algoLeft)
- loadMultiFrames(#BT_algoMiddle)
- loadMultiFrames(#BT_algoRight)
- loadMultiFrames(#BT_algo_topBtn)
- loadMultiFrames(#BT_algo_bottomBtn)
- loadMultiFrames(#BT_continueBtn)
- goTo(#OfficeMonitor_algorithm, #fadeIn)
- end if
- if currentScreen = #allDone then
- goTo(#OfficeMonitor_algorithm, #fadeIn)
- end if
- end if
- end
-
- on backAwayFromLaptop
- global oStoryteller, oPuppeteer, gPsionFrames
- set currentScreen to getState(oStoryteller, #BT_fragStatus)
- if currentScreen = #none then
- put "<!> backAwayFromLaptop(): #BT_fragStatus = #None.. we shouldn't be here!"
- else
- cursorOff()
- if currentScreen = #spinningNow then
- setState(oStoryteller, #BT_fragStatus, #alignment)
- end if
- if getState(oStoryteller, #showMontage) <> 2 then
- setState(oStoryteller, #showMontage, 3)
- updateDisplay(oPuppeteer)
- set resumeTime to the ticks + 60
- else
- set resumeTime to the ticks
- end if
- purgeMultiframes(#BT_checkBox)
- purgeMultiframes(#BT_align_left)
- purgeMultiframes(#BT_align_right)
- purgeMultiframes(#BT_bias1)
- purgeMultiframes(#BT_bias2)
- purgeMultiframes(#BT_bias3)
- purgeMultiframes(#BT_psionFrames)
- repeat while the ticks < resumeTime
- updateStage()
- end repeat
- setState(oStoryteller, #showMontage, 2)
- updateDisplay(oPuppeteer)
- end if
- end
-
- on OLDinitAlignmentPuzzle options
- global oStoryteller, oPuppeteer, gPsionFrames
- set psion1_sprite to 16
- set psion2_sprite to 17
- set psion3_sprite to 18
- set psionFrameStack to getProp(the lsMultiFrames of oPuppeteer, #BT_psionFrames)
- set gPsionFrames to [1, 1, 1]
- set psionSpins to [2, 0, -2]
- set alignmentModifiers to [1, 0, -1]
- set biasModifiers to [1, 0, -1]
- set netSpins to [4, 2, -1]
- set timeSlice to 0
- repeat while not (the mouseDown)
- idle()
- wait(2)
- set timeSlice to timeSlice + 1
- set psionNumber to 1
- repeat with whichSprite = psion1_sprite to psion3_sprite
- if (timeSlice mod (4 - getAt(netSpins, psionNumber))) = 0 then
- set newFrame to (getAt(gPsionFrames, psionNumber) mod 5) + 1
- set the castNum of sprite whichSprite to getAt(psionFrameStack, newFrame)
- setAt(gPsionFrames, psionNumber, newFrame)
- end if
- set psionNumber to psionNumber + 1
- end repeat
- updateStage()
- end repeat
- mouseDown()
- end
-
- on refreshAlignmentPuzzle options
- global oStoryteller, oPuppeteer, gPsionFrames, gPsionSpins
- set psion1_sprite to 16
- set psion2_sprite to 17
- set psion3_sprite to 18
- set psionFrameStack to getProp(the lsMultiFrames of oPuppeteer, #BT_psionFrames)
- if voidp(gPsionFrames) then
- set gPsionFrames to [1, 3, 4]
- updatePsionSpins()
- end if
- set psionNumber to 1
- repeat with whichSprite = psion1_sprite to psion3_sprite
- set mySpin to getAt(gPsionSpins, psionNumber)
- if mySpin = 0 then
- set psionNumber to psionNumber + 1
- next repeat
- end if
- set oldFrame to getAt(gPsionFrames, psionNumber)
- set newFrame to ((oldFrame + mySpin + 23) mod 24) + 1
- set the castNum of sprite whichSprite to getAt(psionFrameStack, newFrame)
- setAt(gPsionFrames, psionNumber, newFrame)
- set psionNumber to psionNumber + 1
- end repeat
- updateStage()
- end
-
- on updatePsionSpins
- global oStoryteller, oPuppeteer, gPsionSpins, gPsionFrames, gOriginPoint, oMemory
- if not listp(gPsionSpins) then
- set gPsionSpins to [1, 1, 1]
- end if
- set inherentSpins to [2, -2, 0]
- set alignmentModifiers to [1, 0, -1]
- set biasModifiers to [0, 0, 0]
- if getState(oStoryteller, #BT_bias) = 1 then
- set biasModifiers to [1, 0, -1]
- end if
- if getState(oStoryteller, #BT_bias) = 2 then
- set biasModifiers to [0, -1, 1]
- end if
- if getState(oStoryteller, #BT_bias) = 3 then
- set biasModifiers to [-1, 1, 0]
- end if
- set psionOrder to getProp(the lsStateData of oStoryteller, #BT_psionOrder)
- set speedCodes to [-6, -4, -2, -1, 0, 1, 2, 4, 6]
- set whichPosition to 1
- repeat with psionNumber in psionOrder
- set alignAdjust to getAt(alignmentModifiers, whichPosition)
- set biasAdjust to getAt(biasModifiers, whichPosition)
- set myInherentSpin to getAt(inherentSpins, psionNumber)
- set newSpeed to myInherentSpin + alignAdjust + biasAdjust
- set frameGap to getAt(speedCodes, newSpeed + 5)
- setAt(gPsionSpins, whichPosition, frameGap)
- set whichPosition to whichPosition + 1
- end repeat
- if gPsionSpins = [0, 0, 0] then
- set gPsionSpins to [2, 2, 2]
- set lastSpin to the ticks
- repeat while (gPsionFrames <> [1, 1, 1]) and not (the optionDown)
- repeat while lastSpin > (the ticks - 4)
- updateStage()
- end repeat
- set lastSpin to the ticks
- refreshAlignmentPuzzle()
- repeat with testPsion = 1 to 3
- set currentFrame to getAt(gPsionFrames, testPsion)
- if currentFrame < 12 then
- setAt(gPsionSpins, testPsion, -2)
- end if
- if currentFrame < 6 then
- setAt(gPsionSpins, testPsion, -1)
- end if
- if currentFrame > 12 then
- setAt(gPsionSpins, testPsion, 2)
- end if
- if currentFrame > 18 then
- setAt(gPsionSpins, testPsion, 1)
- end if
- if currentFrame = 1 then
- setAt(gPsionSpins, testPsion, 0)
- end if
- end repeat
- end repeat
- set gPsionSpins to [0, 0, 0]
- soundEffect(#happyBeep)
- wait(10)
- purgeMultiframes(#BT_align_left)
- purgeMultiframes(#BT_align_right)
- purgeMultiframes(#BT_bias1)
- purgeMultiframes(#BT_bias2)
- purgeMultiframes(#BT_bias3)
- purgeMultiframes(#BT_psionFrames)
- if objectp(oMemory) then
- oMemory(mCompact)
- end if
- set the castNum of sprite 44 to 7
- updateStage()
- set the castNum of sprite 44 to 2381
- setState(oStoryteller, #BT_fragStatus, #algoPrompt)
- set the visible of sprite 44 to 0
- set the loc of sprite 44 to point(258, 221) + gOriginPoint
- set the visible of sprite 44 to 1
- updateStage()
- pushVideo()
- wait(#videoStop)
- set the castNum of sprite 44 to the number of cast getProp(the lsForegroundData of oPuppeteer, #algo_prompt)
- set the visible of sprite 44 to 0
- set the loc of sprite 44 to point(321, 212) + gOriginPoint
- set the visible of sprite 44 to 1
- updateStage()
- pushVideo()
- wait(#videoStop)
- goTo(#OfficeMonitor_algorithm)
- end if
- end
-
- on setFragmentAlignment option
- global oStoryteller, oPuppeteer
- set checkFrames to getProp(the lsMultiFrames of oPuppeteer, #BT_checkBox)
- set leftFrames to getProp(the lsMultiFrames of oPuppeteer, #BT_align_left)
- set rightFrames to getProp(the lsMultiFrames of oPuppeteer, #BT_align_right)
- set currentPsionOrder to getProp(the lsStateData of oStoryteller, #BT_psionOrder)
- set currentState to getState(oStoryteller, #BT_alignmentLeft)
- if currentState <> #off then
- set currentState to #on
- end if
- set checkSprite to 19
- set leftAlignSprite to 20
- set rightAlignSprite to 21
- if option = #toggle then
- if currentState = #on then
- setProp(the lsStateData of oStoryteller, #BT_alignmentLeft, [#off])
- setProp(the lsStateData of oStoryteller, #BT_alignmentRight, [#off])
- set the castNum of sprite checkSprite to getProp(checkFrames, #off)
- set the castNum of sprite leftAlignSprite to getProp(leftFrames, #off)
- set the castNum of sprite rightAlignSprite to getProp(rightFrames, #off)
- updateStage()
- else
- setProp(the lsStateData of oStoryteller, #BT_alignmentLeft, [#on])
- setProp(the lsStateData of oStoryteller, #BT_alignmentRight, [#on])
- set the castNum of sprite checkSprite to getProp(checkFrames, #on)
- set the castNum of sprite leftAlignSprite to getProp(leftFrames, #on)
- set the castNum of sprite rightAlignSprite to getProp(rightFrames, #on)
- updateStage()
- end if
- end if
- if currentState = #on then
- if option = #clockWise then
- set newFirst to getAt(currentPsionOrder, 3)
- deleteAt(currentPsionOrder, 3)
- addAt(currentPsionOrder, 1, newFirst)
- migrateParticles(#clockWise)
- refreshAlignmentPuzzle()
- updatePsionSpins()
- end if
- if option = #counter then
- set newLast to getAt(currentPsionOrder, 1)
- deleteAt(currentPsionOrder, 1)
- addAt(currentPsionOrder, 3, newLast)
- migrateParticles(#counter)
- refreshAlignmentPuzzle()
- updatePsionSpins()
- end if
- end if
- end
-
- on setFragmentBias option
- global oStoryteller, oPuppeteer
- set checkFrames to getProp(the lsMultiFrames of oPuppeteer, #BT_checkBox)
- set bias1Frames to getProp(the lsMultiFrames of oPuppeteer, #BT_bias1)
- set bias2Frames to getProp(the lsMultiFrames of oPuppeteer, #BT_bias2)
- set bias3Frames to getProp(the lsMultiFrames of oPuppeteer, #BT_bias3)
- set currentState to getState(oStoryteller, #BT_bias)
- set checkSprite to 22
- set bias1Sprite to 23
- set bias2Sprite to 24
- set bias3Sprite to 25
- if option = #toggle then
- if currentState = #off then
- set newState to getState(oStoryteller, #BT_storedBias)
- setState(oStoryteller, #BT_bias, newState)
- set the castNum of sprite checkSprite to getProp(checkFrames, #on)
- set the castNum of sprite bias1Sprite to getProp(bias1Frames, newState)
- set the castNum of sprite bias2Sprite to getProp(bias2Frames, newState)
- set the castNum of sprite bias3Sprite to getProp(bias3Frames, newState)
- updateStage()
- else
- setState(oStoryteller, #BT_bias, #off)
- set the castNum of sprite checkSprite to getProp(checkFrames, #off)
- set the castNum of sprite bias1Sprite to getProp(bias1Frames, #off)
- set the castNum of sprite bias2Sprite to getProp(bias2Frames, #off)
- set the castNum of sprite bias3Sprite to getProp(bias3Frames, #off)
- updateStage()
- end if
- end if
- if currentState <> #off then
- if getPos([1, 2, 3, #none], option) <> 0 then
- setState(oStoryteller, #BT_bias, option)
- setState(oStoryteller, #BT_storedBias, option)
- set the castNum of sprite bias1Sprite to getProp(bias1Frames, option)
- set the castNum of sprite bias2Sprite to getProp(bias2Frames, option)
- set the castNum of sprite bias3Sprite to getProp(bias3Frames, option)
- end if
- end if
- updatePsionSpins()
- end
-
- on migrateParticles direction
- global oStoryteller, oPuppeteer, gPsionFrames
- set oldFP to the floatPrecision
- set the floatPrecision to 1
- set psion1_sprite to 16
- set psion2_sprite to 17
- set psion3_sprite to 18
- set numberOfSteps to 30
- set swellPixels to 4
- set start1 to the loc of sprite psion1_sprite * 1
- set start2 to the loc of sprite psion2_sprite
- set start3 to the loc of sprite psion3_sprite
- if direction = #clockWise then
- set dest1 to start2
- set dest2 to start3
- set dest3 to start1
- else
- set dest1 to start3
- set dest2 to start1
- set dest3 to start2
- end if
- set distanceFactor to 1.0 / numberOfSteps
- set delta1 to dest1 - start1
- set delta2 to dest2 - start2
- set delta3 to dest3 - start3
- repeat with step = 1 to numberOfSteps
- set newMultiplier to step * distanceFactor
- set swellMultiplier to 1 - abs(1 - (newMultiplier * 2))
- set swellVector to integer(swellPixels * swellMultiplier)
- set offset1 to delta1 * newMultiplier
- set newLoc to start1 + offset1
- if direction = #clockWise then
- set Xint to integer(getAt(newLoc, 1))
- set Yint to integer(getAt(newLoc, 2)) - swellVector
- else
- set Xint to integer(getAt(newLoc, 1)) - swellVector
- set Yint to integer(getAt(newLoc, 2))
- end if
- set intLoc to point(Xint, Yint)
- set the loc of sprite psion1_sprite to intLoc
- set offset2 to delta2 * newMultiplier
- set newLoc to start2 + offset2
- if direction = #clockWise then
- set Xint to integer(getAt(newLoc, 1)) + swellVector
- set Yint to integer(getAt(newLoc, 2))
- else
- set Xint to integer(getAt(newLoc, 1))
- set Yint to integer(getAt(newLoc, 2)) - swellVector
- end if
- set intLoc to point(Xint, Yint)
- set the loc of sprite psion2_sprite to intLoc
- set offset3 to delta3 * newMultiplier
- set newLoc to start3 + offset3
- if direction = #clockWise then
- set Xint to integer(getAt(newLoc, 1)) - swellVector
- set Yint to integer(getAt(newLoc, 2))
- else
- set Xint to integer(getAt(newLoc, 1)) + swellVector
- set Yint to integer(getAt(newLoc, 2))
- end if
- set intLoc to point(Xint, Yint)
- set the loc of sprite psion3_sprite to intLoc
- refreshAlignmentPuzzle()
- end repeat
- if direction = #clockWise then
- set temp to getAt(gPsionFrames, 3)
- deleteAt(gPsionFrames, 3)
- addAt(gPsionFrames, 1, temp)
- else
- set temp to getAt(gPsionFrames, 1)
- deleteAt(gPsionFrames, 1)
- addAt(gPsionFrames, 3, temp)
- end if
- set the loc of sprite psion1_sprite to start1
- set the loc of sprite psion2_sprite to start2
- set the loc of sprite psion3_sprite to start3
- set the floatPrecision to oldFP
- end
-
- on adjustAlgorithm whichColumn, upOrDown
- global oStoryteller, oPuppeteer, gOriginPoint, oMemory
- cursorOff()
- if whichColumn = #left then
- set columnStack to getProp(the lsMultiFrames of oPuppeteer, #BT_algoLeft)
- end if
- if whichColumn = #middle then
- set columnStack to getProp(the lsMultiFrames of oPuppeteer, #BT_algoMiddle)
- end if
- if whichColumn = #right then
- set columnStack to getProp(the lsMultiFrames of oPuppeteer, #BT_algoRight)
- end if
- set columnSprite to 0
- repeat with i = 10 to 48
- if getPos(columnStack, the castNum of sprite i) then
- set columnSprite to i
- exit repeat
- end if
- end repeat
- startTimer()
- set lagTime to 0
- repeat while the stillDown or (the timer < 2)
- if the timer > lagTime then
- if whichColumn = #left then
- set currentSetting to getState(oStoryteller, #BT_algorithmLeft)
- if upOrDown = #up then
- set newSetting to currentSetting - 1
- end if
- if upOrDown = #down then
- set newSetting to currentSetting + 1
- end if
- end if
- if whichColumn = #middle then
- set currentSetting to getState(oStoryteller, #BT_algorithmMiddle)
- if upOrDown = #up then
- set newSetting to currentSetting - 1
- end if
- if upOrDown = #down then
- set newSetting to currentSetting + 1
- end if
- end if
- if whichColumn = #right then
- set currentSetting to getState(oStoryteller, #BT_algorithmRight)
- if upOrDown = #up then
- set newSetting to currentSetting - 1
- end if
- if upOrDown = #down then
- set newSetting to currentSetting + 1
- end if
- end if
- if (newSetting < 1) or (newSetting > 8) then
- soundEffect(#algorithmNotAvail)
- exit repeat
- else
- if whichColumn = #left then
- setProp(the lsStateData of oStoryteller, #BT_algorithmLeft, list(newSetting))
- end if
- if whichColumn = #middle then
- setProp(the lsStateData of oStoryteller, #BT_algorithmMiddle, list(newSetting))
- end if
- if whichColumn = #right then
- setProp(the lsStateData of oStoryteller, #BT_algorithmRight, list(newSetting))
- end if
- set the castNum of sprite columnSprite to getProp(columnStack, newSetting)
- updateStage()
- end if
- set lagTime to lagTime + 40
- end if
- end repeat
- if getState(oStoryteller, #BT_algorithmLeft) <> 5 then
- exit
- end if
- if getState(oStoryteller, #BT_algorithmMiddle) <> 2 then
- exit
- end if
- if getState(oStoryteller, #BT_algorithmRight) <> 8 then
- exit
- end if
- cursorOff()
- wait(60)
- soundEffect(#happyBeep)
- wait(10)
- purgeMultiframes(#BT_algoLeft)
- purgeMultiframes(#BT_algoMiddle)
- purgeMultiframes(#BT_algoRight)
- purgeMultiframes(#BT_algo_topBtn)
- purgeMultiframes(#BT_algo_bottomBtn)
- purgeMultiframes(#BT_continueBtn)
- if objectp(oMemory) then
- oMemory(mCompact)
- end if
- set the castNum of sprite 44 to 7
- updateStage()
- set the castNum of sprite 44 to 2351
- set the visible of sprite 44 to 0
- set the loc of sprite 44 to point(321, 212) + gOriginPoint
- set the visible of sprite 44 to 1
- updateStage()
- pushVideo()
- wait(#videoStop)
- setState(oStoryteller, #BT_fragStatus, #allDone)
- setState(oStoryteller, #endGame, 1)
- updateDisplay(oPuppeteer)
- end
-